<%--
  Created by IntelliJ IDEA.
  User: dailyblue
  Date: 2023/4/2
  Time: 11:37
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" isELIgnored="false" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="C" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <title>Title</title>
</head>
<body>
<%
    request.setAttribute("A", (int) (Math.random() * 100 + 1));
%>
<h3>单层if</h3>
<c:if test="${A%2==0}">
    ${A}是偶数！
</c:if>
<H3>if-else</H3>
<c:choose>
    <c:when test="${A%2==0}">
        ${A}是偶数
    </c:when>
    <c:otherwise>
        ${A}是奇数
    </c:otherwise>
</c:choose>
<h3>多重if</h3>
<c:choose>
   <c:when test="${A==100}">
       完美
   </c:when>
    <c:when test="${A>=85}">
        ${A}是优秀
    </c:when>
    <c:when test="${A>=60}">
        ${A}及格
    </c:when>
    <c:otherwise>
        ${A}比较差
    </c:otherwise>
</c:choose>
</body>
</html>
